type Bool enum {
    type Yes;
    type No;
};
export const Yes: Bool { |Bool| { |Yes| () } };
export const No: Bool { |Bool| { |No| () } };

export method Bool.String: String
    &(p) => if p: 'Yes', else: 'No';

export function =:
    &(Bool,Bool) => Bool
    native '__EnumIndexEqual';

export function continue:[T]
    &({ when: Bool, otherwise: T }, &() => T) => T
    &(arg, k) =>
        let {when,otherwise} := arg,
        if when:
            { k () },
        else:
            otherwise;

export function not:
    &(Bool) => Bool
    &(p) => (if p: No, else: Yes);

export function and:
    &(Bool,Bool) => Bool
    &(p,q) => (if p: (if q: Yes, else: No), else: No);

export function or:
    &(Bool,Bool) => Bool
    &(p,q) => (if p: Yes, else: (if q: Yes, else: No));


